Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Teleport and getting stuck problem

  1. #11

    Default

    Just tried this myself and thank you for this guys it works great!

    i use map m5l1a with towers you can teleport into and quite a few times players would get stuck together on entry. I'm hoping this fixes this issue although i have not had chance to test it in my server with players yet.

    The only thing is i had to press key E to use the teleport.
    I prefer teleports without this function so a player just simply walks into it and is teleported to their destination without pressing any buttons.

    Any ideas what command to add to this script to make it so no button press is required?

  2. #12
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    To make the trigger not require the 'use' key or 'E' to be used, you need to change it from a trigger_use to a trigger_multiple .

    Code:
    local.trig = spawn trigger_use origin local.fx.origin
    TO
    local.trig = spawn trigger_multiple origin local.fx.origin
    I was just thinking of this , what about before it teleports the player, it checks to make sure the destination is free before it allows the teleport to be used.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #13

    Default

    Armageddon had this on his CrazyGamers server, but I don't think he made it public.
    When trying to teleport and the destination was occupied you got a message that there was someone at the other end, and
    it was only cleared when that player moved from the destination.

    But Arma is not active on forum anymore, alas

  4. #14

    Default

    the push works awesome, and most of the time the end of teleport is in a corner or on a weird space where people dont stand or sitt.... so i say push is the best!

  5. #15

    Default

    thanks for that Purple it works without button press now

    not sure i like the idea of you can't use a teleport if someone's at the other end.
    If it was in my towers i know for sure some clown would decide to sit on the destination spot and not let anyone get in at all. The way it is now at least anyone can get in and fight for the tower. The push teleport means they don't get stuck together which is perfect.

  6. #16

    Default Good idea!

    Quote Originally Posted by Purple Elephant1au View Post
    To make the trigger not require the 'use' key or 'E' to be used, you need to change it from a trigger_use to a trigger_multiple .

    Code:
    local.trig = spawn trigger_use origin local.fx.origin
    TO
    local.trig = spawn trigger_multiple origin local.fx.origin
    I was just thinking of this , what about before it teleports the player, it checks to make sure the destination is free before it allows the teleport to be used.
    Yes, that is a good idea Purple!
    Only thing is a player could still sabotage the game by staying put after they teleport..
    But how about creating multiple exits?

    I've made this multi-exit teleport script that gives access to a bashing-only area behind the west gate at map 4.
    It uses two array's, one for the destination coords and another one to correctly 'face' the player after teleport.

    Would it be possible to add a check that detects if a destination is occupied, and if so skips to the next destination etc. etc. ?

    This is what I have so far:

    Code:
    port6:
    level.dest = makeArray
    " 0 4973 254.46 "
    " -134 6271 317.21 "
    " 777 6541 351.12 "
    " 900 7612 325.80 "
    " 2240 7217 320.13 "
    endArray
    
    level.face = makeArray
    " 0 90 0 "
    " 0 -73 0 "
    " 0 102 0 "
    " 0 -114 0 "
    " 0 164 0 "
    endArray
    
    local.fx = spawn script_model model "fx/corona_red.tik"
    local.fx.origin = ( 0 4746 322 )
    local.fx notsolid
    local.fx.scale = 2
    
    local.trig = spawn trigger_use
    local.trig.origin = local.fx.origin
    local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
    
    local.num = 1
    while(1)
    {
    local.trig waitTill trigger
    local.fx hide
    local.player = parm.other
    local.player tele level.dest[local.num][1]
    local.player face level.face[local.num][1]
        if(getcvar "hammer" == "1")
            {
            exec global/spawnhandler.scr::hammer local.player
            local.player iprint "You have HAMMER ONLY behind this gate!" 1
            local.player.name = netname local.player
            iprintln ("Basher '" + local.player.name + "' has just entered the Bashing-Area!")
            }
    local.num ++
    if(local.num > level.dest.size  && local.num > level.face.size) {local.num = 1}
    wait 2
    local.fx show
    }
    end

    I've searched the bowels of the internet because I can remember seeing a thread on some
    forum about a trigger that checked if the tele destination was blocked and would not
    release the trigger until the destination was vacant. But can't find it anywhere anymore...
    But with a multiple exit teleport, it would just teleport you to the next destination

    Could that be done, Purple?
    Last edited by Midnight1138; April 26th, 2014 at 05:12 PM.

  7. #17
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    I had just replied to a post of yours on TMT , but you could use the same method i think ,

    This is untested but i think is along the lines of what needs to be done, you might have to adjust the vector_within radius to suit your needs
    Code:
    port6:
    level.dest = makeArray
    " 0 4973 254.46 "
    " -134 6271 317.21 "
    " 777 6541 351.12 "
    " 900 7612 325.80 "
    " 2240 7217 320.13 "
    endArray
    
    level.face = makeArray
    " 0 90 0 "
    " 0 -73 0 "
    " 0 102 0 "
    " 0 -114 0 "
    " 0 164 0 "
    endArray
    
    local.fx = spawn script_model model "fx/corona_red.tik"
    local.fx.origin = ( 0 4746 322 )
    local.fx notsolid
    local.fx.scale = 2
    
    local.trig = spawn trigger_use
    local.trig.origin = local.fx.origin
    local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
    
    local.num = 1
    
    while(1)
    {
    local.trig waitTill trigger
    local.fx hide
    local.player = parm.other
    
        ///Loops through until the player is teleported
        while(local.player.teleported != 1)
        {
        //Resets occupied status
        local.tele_occupied = 0
        
        //loops all players, 
        for(local.i = 1; local.i <= $player.size;i++)
              {
                local.person = $player[local.i]   
                    ///Checks if destination is occupied by a player , if it is , then sets local.tele_occupied = 1 
                    if(vector_within level.dest[local.num][1] local.person.origin 25) // adjust radius if needed 
                    local.tele_occupied = 1
              }
              
              //If occupied, then skips to next destination
              if(local.tele_occupided == 1)
                  {
                  local.num ++
                  //Double check we dnt go over limit
                  if(local.num > level.dest.size  && local.num > level.face.size)
                  local.num = 1
                  }
              else
                  {
                 /// If not occupied, teleports player
                 local.player tele level.dest[local.num][1]
                 local.player face level.face[local.num][1]
                 local.player.teleported = 1
        
                    if(getcvar "hammer" == "1")
                        {
                        exec global/spawnhandler.scr::hammer local.player
                        local.player iprint "You have HAMMER ONLY behind this gate!" 1
                        local.player.name = netname local.player
                        iprintln ("Basher '" + local.player.name + "' has just entered the Bashing-Area!")
                        } 
                                
                break;
                 }     
        }
    
         
    local.num ++
    if(local.num > level.dest.size  && local.num > level.face.size)
    local.num = 1
    
    wait 2
    local.fx show
    }
    end

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  8. #18

    Default

    Thanks mate! I'll try both the x-null and TMT scripts and let you know tomorrow.
    It's getting late in my country, lol!

    Cheers!

  9. #19

    Default

    Hi Purple,

    tested the script and it works. But only the first time, then the trigger is dead.
    Corrected a typo (i think) marked in red to "if(local.tele_occupied == 1)" but that didn't fix it.
    Must be something going wrong with the counter?


    Quote Originally Posted by Purple Elephant1au View Post
    I had just replied to a post of yours on TMT , but you could use the same method i think ,

    This is untested but i think is along the lines of what needs to be done, you might have to adjust the vector_within radius to suit your needs
    Code:
    port6:
    level.dest = makeArray
    " 0 4973 254.46 "
    " -134 6271 317.21 "
    " 777 6541 351.12 "
    " 900 7612 325.80 "
    " 2240 7217 320.13 "
    endArray
    
    level.face = makeArray
    " 0 90 0 "
    " 0 -73 0 "
    " 0 102 0 "
    " 0 -114 0 "
    " 0 164 0 "
    endArray
    
    local.fx = spawn script_model model "fx/corona_red.tik"
    local.fx.origin = ( 0 4746 322 )
    local.fx notsolid
    local.fx.scale = 2
    
    local.trig = spawn trigger_use
    local.trig.origin = local.fx.origin
    local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
    
    local.num = 1
    
    while(1)
    {
    local.trig waitTill trigger
    local.fx hide
    local.player = parm.other
    
        ///Loops through until the player is teleported
        while(local.player.teleported != 1)
        {
        //Resets occupied status
        local.tele_occupied = 0
        
        //loops all players, 
        for(local.i = 1; local.i <= $player.size;i++)
              {
                local.person = $player[local.i]   
                    ///Checks if destination is occupied by a player , if it is , then sets local.tele_occupied = 1 
                    if(vector_within level.dest[local.num][1] local.person.origin 25) // adjust radius if needed 
                    local.tele_occupied = 1
              }
              
              //If occupied, then skips to next destination
              if(local.tele_occupided == 1)
                  {
                  local.num ++
                  //Double check we dnt go over limit
                  if(local.num > level.dest.size  && local.num > level.face.size)
                  local.num = 1
                  }
              else
                  {
                 /// If not occupied, teleports player
                 local.player tele level.dest[local.num][1]
                 local.player face level.face[local.num][1]
                 local.player.teleported = 1
        
                    if(getcvar "hammer" == "0")
                        {
                        exec global/spawnhandler.scr::hammer local.player
                        local.player iprint "You have HAMMER ONLY behind this gate!" 1
                        local.player.name = netname local.player
                        iprintln ("Basher '" + local.player.name + "' has just entered the Bashing-Area!")
                        } 
                                
                break;
                 }     
        }
    
         
    local.num ++
    if(local.num > level.dest.size  && local.num > level.face.size)
    local.num = 1
    
    wait 2
    local.fx show
    }
    end

  10. #20
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Ops yea looks like my bad again with the typo lol

    Try this one, i removed the break; which was probably causing it , i was working on my schoolwork when i wrote it lol different programming language , shocked i didnt write end Loop; or return; lol

    also added a iprintln when its occupied to help with the testing, can remove it when you want..

    Code:
    port6:
    level.dest = makeArray
    " 0 4973 254.46 "
    " -134 6271 317.21 "
    " 777 6541 351.12 "
    " 900 7612 325.80 "
    " 2240 7217 320.13 "
    endArray
    
    level.face = makeArray
    " 0 90 0 "
    " 0 -73 0 "
    " 0 102 0 "
    " 0 -114 0 "
    " 0 164 0 "
    endArray
    
    local.fx = spawn script_model model "fx/corona_red.tik"
    local.fx.origin = ( 0 4746 322 )
    local.fx notsolid
    local.fx.scale = 2
    
    local.trig = spawn trigger_use
    local.trig.origin = local.fx.origin
    local.trig setsize ( -10 -10 -10 ) ( 10 10 10 )
    
    local.num = 1
    
    while(1)
    {
    local.trig waitTill trigger
    local.fx hide
    local.player = parm.other
    
        ///Loops through until the player is teleported
        while(local.player.teleported != 1)
        {
        //Resets occupied status
        local.tele_occupied = 0
        
        //loops all players, 
        for(local.i = 1; local.i <= $player.size;i++)
              {
                local.person = $player[local.i]   
                    ///Checks if destination is occupied by a player , if it is , then sets local.tele_occupied = 1 
                    if(vector_within level.dest[local.num][1] local.person.origin 25) // adjust radius if needed 
                    local.tele_occupied = 1
              }
              
              //If occupied, then skips to next destination
              if(local.tele_occupied == 1)
                  {
                  
                  iprintln "Occupied"
                  
                  local.num ++
                  //Double check we dnt go over limit
                  if(local.num > level.dest.size  && local.num > level.face.size)
                  local.num = 1
                  }
              else
                  {
                 /// If not occupied, teleports player
                 local.player tele level.dest[local.num][1]
                 local.player face level.face[local.num][1]
                 local.player.teleported = 1
        
                    if(getcvar "hammer" == "1")
                        {
                        exec global/spawnhandler.scr::hammer local.player
                        local.player iprint "You have HAMMER ONLY behind this gate!" 1
                        local.player.name = netname local.player
                        iprintln ("Basher '" + local.player.name + "' has just entered the Bashing-Area!")
                        } 
                 }     
        }
    
         
    local.num ++
    if(local.num > level.dest.size  && local.num > level.face.size)
    local.num = 1
    
    wait 2
    local.fx show
    }
    end

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •